# Few-shot Examples for DSL Scene Generation
# Lines before line 340 are few-shot examples for filling.
# The template looking of prompt starts at line 340.
# Example Scene: Multi-room scene with kitchen, living rooms, bedrooms, and bathrooms
AddRoom('kitchen', id=1)
AddRoom('living', id=1)
AddRoom('living', id=2)
AddRoom('living', id=3)
AddRoom('bedroom', id=1)
AddRoom('bathroom', id=1)
AddRoom('bedroom', id=2)
AddRoom('bathroom', id=2)
AddRoom('bedroom', id=3)
AddRoom('bathroom', id=3)
SetAgent(r='kitchen_1')
AddFurn('arm_chair', r='bedroom_3', id=1)
AddFurn('bed', r='bedroom_3', id=1)
AddFurn('bed', r='bedroom_2', id=2, states={'is_dirty': False})
AddFurn('bed', r='bedroom_1', id=3, states={'is_dirty': True})
AddFurn('chair', r='bedroom_1', id=1)
AddFurn('chair', r='bedroom_1', id=2)
AddFurn('chair', r='living_1', id=3)
AddFurn('chair', r='living_1', id=4)
AddFurn('chair', r='living_2', id=5)
AddFurn('chair', r='living_3', id=6)
AddFurn('chair', r='living_2', id=7)
AddFurn('chair', r='living_1', id=8)
AddFurn('chair', r='living_2', id=9)
AddFurn('chair', r='living_3', id=10)
AddFurn('chair', r='living_3', id=11)
AddFurn('chair', r='living_1', id=12)
AddFurn('counter_top', r='kitchen_1', id=1)
AddFurn('dining_table', r='living_3', id=1)
AddFurn('dining_table', r='living_1', id=2)
AddFurn('dining_table', r='living_2', id=3)
AddFurn('dining_table', r='bedroom_1', id=4)
AddFurn('dog_bed', r='living_2', id=1)
AddFurn('drawer', r='bedroom_2', id=7, states={'can_be_opened': True, 'is_open': False})
AddFurn('drawer', r='bedroom_2', id=9, states={'can_be_opened': True, 'is_open': False})
AddFurn('drawer', r='bedroom_2', id=10, states={'can_be_opened': True, 'is_open': False})
AddFurn('drawer', r='bedroom_3', id=11, states={'can_be_opened': True, 'is_open': False})
AddFurn('dresser', r='bedroom_3', id=1)
AddFurn('dresser', r='bedroom_2', id=2)
AddFurn('dresser', r='bedroom_1', id=3)
AddFurn('fridge', r='kitchen_1', id=1, states={'can_be_opened': True, 'is_open': False})
AddFurn('garbage_can', r='bathroom_2', id=1)
AddFurn('garbage_can', r='living_1', id=2)
AddFurn('garbage_can', r='bedroom_3', id=3)
AddFurn('garbage_can', r='bathroom_1', id=4)
AddFurn('garbage_can', r='bathroom_3', id=5)
AddFurn('shelf', r='living_3', id=3)
AddFurn('shelf', r='living_3', id=4)
AddFurn('shelf', r='living_2', id=5)
AddFurn('shelf', r='living_1', id=6)
AddFurn('sink', r='bathroom_2', id=1)
AddFurn('sink', r='bathroom_3', id=2)
AddFurn('sink', r='bathroom_1', id=3)
AddFurn('sofa', r='living_3', id=1)
AddFurn('sofa', r='living_1', id=2)
AddFurn('toilet', r='bathroom_3', id=1, states={'can_be_opened': True, 'is_open': False})
AddFurn('toilet', r='bathroom_2', id=2, states={'can_be_opened': True, 'is_open': False})
AddFurn('toilet', r='bathroom_1', id=3, states={'can_be_opened': True, 'is_open': False})
AddFurn('tv_stand', r='living_3', id=1)
AddFurn('tv_stand', r='living_2', id=2)
AddFurn('tv_stand', r='living_1', id=3)
AddFurn('washing_machine', r='bathroom_3', id=1)
Place('alarm_clock', p='dresser_3', id=1, rel='on')
Place('apple', p='fridge_1', id=1, rel='in', states={'is_sliced': False})
Place('baseball_bat', p='bed_2', id=1, rel='on')
Place('book', p='bed_1', id=1, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('book', p='dresser_1', id=3, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('book', p='dining_table_1', id=4, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('book', p='dining_table_2', id=5, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('book', p='counter_top_1', id=7, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('bowl', p='dining_table_4', id=1, rel='on', states={'is_broken': False, 'is_dirty': False, 'is_filled': False, 'empty': True})
Place('bowl', p='counter_top_1', id=2, rel='on', states={'is_broken': False, 'is_dirty': False, 'is_filled': False, 'empty': True})
Place('bowl', p='chair_3', id=4, rel='on', states={'is_broken': False, 'is_dirty': False, 'is_filled': False, 'empty': True})
Place('bowl', p='dining_table_1', id=5, rel='on', states={'is_dirty': False, 'is_filled': False, 'empty': True})
Place('box', p='bed_3', id=1, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('box', p='chair_1', id=2, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('box', p='dining_table_4', id=2, rel='on', states={'can_be_opened': True, 'is_open': False})
Place('butter_knife', p='counter_top_1', id=1, rel='on')
Place('butter_knife', p='counter_top_1', id=2, rel='on')
Place('candle', p='toilet_2', id=3, rel='in', states={'is_powerable': True, 'is_powered_on': False})
Place('candle', p='garbage_can_2', id=4, rel='on')
Place('cell_phone', p='bed_1', id=1, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('cell_phone', p='dresser_1', id=2, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('cell_phone', p='dresser_2', id=5, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('cell_phone', p='dining_table_4', id=6, rel='on')
Place('cell_phone', p='dining_table_4', id=7, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('credit_card', p='tv_stand_1', id=3, rel='on')
Place('desk_lamp', p='dresser_1', id=1, rel='on')
Place('desk_lamp', p='dining_table_1', id=2, rel='on', states={'is_powerable': True, 'is_powered_on': True})
Place('desk_lamp', p='chair_1', id=3, rel='on', states={'is_powerable': True, 'is_powered_on': True})
Place('desk_lamp', p='chair_2', id=3, rel='on', states={'is_powerable': True, 'is_powered_on': True})
Place('desk_lamp', p='dining_table_4', id=3, rel='on', states={'is_powerable': True, 'is_powered_on': True})
Place('egg', p='counter_top_1', id=1, rel='on', states={'is_broken': False, 'is_sliced': False})
Place('faucet', p='sink_3', id=1, rel='on', states={'is_powerable': True, 'is_powered_on': False})
Place('faucet', p='sink_1', id=2, rel='on', states={'is_powerable': True, 'is_powered_on': False})
Place('faucet', p='sink_2', id=3, rel='on', states={'is_powerable': True, 'is_powered_on': False})
Place('house_plant', p='dining_table_3', id=2, rel='on', states={'is_filled': False, 'empty': True})
Place('kettle', p='counter_top_1', id=1, rel='on', states={'can_be_opened': True, 'is_open': False, 'is_filled': False, 'empty': True})
Place('ladle', p='counter_top_1', id=1, rel='on')
Place('laptop', p='dresser_2', id=1, rel='on', states={'can_be_opened': True, 'is_open': True, 'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('laptop', p='dresser_1', id=2, rel='on', states={'can_be_opened': True, 'is_open': True, 'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('laptop', p='dining_table_1', id=3, rel='on', states={'can_be_opened': True, 'is_open': True, 'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('laptop', p='bed_3', id=4, rel='on', states={'can_be_opened': True, 'is_open': True, 'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('mug', p='chair_2', id=1, rel='on')
Place('mug', p='dining_table_4', id=1, rel='on')
Place('newspaper', p='sofa_2', id=2, rel='on')
Place('pan', p='counter_top_1', id=1, rel='on', states={'is_dirty': False})
Place('paper_towel_roll', p='counter_top_1', id=1, rel='on')
Place('pen', p='dining_table_1', id=1, rel='on')
Place('pen', p='chair_1', id=3, rel='on')
Place('pen', p='dining_table_4', id=3, rel='on')
Place('pencil', p='dining_table_2', id=1, rel='on')
Place('pencil', p='tv_stand_3', id=2, rel='on')
Place('pencil', p='dresser_1', id=3, rel='on')
Place('pencil', p='dining_table_1', id=4, rel='on')
Place('pillow', p='bed_3', id=1, rel='on')
Place('pillow', p='sofa_2', id=2, rel='on')
Place('pillow', p='bed_2', id=3, rel='on')
Place('pillow', p='bed_3', id=4, rel='on')
Place('pillow', p='bed_1', id=5, rel='on')
Place('pillow', p='sofa_1', id=6, rel='on')
Place('plate', p='dining_table_3', id=1, rel='on', states={'is_broken': False, 'is_dirty': False})
Place('plate', p='dining_table_1', id=3, rel='on', states={'is_broken': False, 'is_dirty': False})
Place('potato', p='counter_top_1', id=1, rel='on', states={'is_cooked': False, 'is_sliced': False, 'uncooked': True, 'intact': True})
Place('remote_control', p='dresser_3', id=1, rel='on')
Place('remote_control', p='dining_table_1', id=3, rel='on')
Place('remote_control', p='sofa_2', id=4, rel='on')
Place('salt_shaker', p='counter_top_1', id=1, rel='on')
Place('soap_bar', p='toilet_2', id=1, rel='in')
Place('soap_bar', p='toilet_3', id=2, rel='in')
Place('spoon', p='counter_top_1', id=1, rel='on')
Place('spray_bottle', p='toilet_3', id=1, rel='in')
Place('spray_bottle', p='counter_top_1', id=2, rel='on')
Place('spray_bottle', p='toilet_1', id=3, rel='in')
Place('statue', p='dining_table_2', id=1, rel='on', states={'is_broken': False})
Place('statue', p='dining_table_3', id=2, rel='on', states={'is_broken': False})
Place('statue', p='dresser_2', id=4, rel='on', states={'is_broken': False})
Place('teddy_bear', p='bed_2', id=1, rel='on')
Place('television', p='tv_stand_3', id=1, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('television', p='tv_stand_2', id=2, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('television', p='tv_stand_1', id=4, rel='on', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('tennis_racket', p='bed_1', id=1, rel='on')
Place('toilet_paper', p='toilet_2', id=1, rel='in')
Place('toilet_paper', p='toilet_1', id=2, rel='in')
Place('toilet_paper', p='garbage_can_4', id=3, rel='on')
Place('tomato', p='fridge_1', id=1, rel='in', states={'is_sliced': False})
Place('vase', p='dining_table_2', id=2, rel='on', states={'is_broken': False})
Place('watch', p='dining_table_2', id=1, rel='on')
Place('watch', p='dining_table_4', id=2, rel='on')
Place('watch', p='dining_table_1', id=3, rel='on')
Place('wine_bottle', p='counter_top_1', id=1, rel='on', states={'is_broken': False, 'is_filled': True, 'empty': False})
Place('book', r='living_3', id=2, rel='in', states={'can_be_opened': True, 'is_open': False})
Place('book', r='bedroom_2', id=6, rel='in', states={'can_be_opened': True, 'is_open': False})
Place('bowl', r='living_2', id=3, rel='in', states={'is_dirty': False, 'is_filled': False, 'empty': True})
Place('candle', r='living_1', id=1, rel='in', states={'is_powerable': True, 'is_powered_on': False})
Place('candle', r='living_2', id=2, rel='in', states={'is_powerable': True, 'is_powered_on': False})
Place('cd', r='bedroom_3', id=1, rel='in')
Place('cd', r='bedroom_2', id=2, rel='in')
Place('cell_phone', r='living_1', id=3, rel='in')
Place('cell_phone', r='living_1', id=4, rel='in')
Place('credit_card', r='living_1', id=1, rel='in')
Place('credit_card', r='bedroom_3', id=2, rel='in')
Place('dish_sponge', r='bathroom_2', id=1, rel='in')
Place('dish_sponge', r='bathroom_3', id=2, rel='in')
Place('floor_lamp', r='bedroom_3', id=1, rel='in', states={'is_powerable': True, 'is_powered_on': False})
Place('floor_lamp', r='living_2', id=2, rel='in', states={'is_powerable': True, 'is_powered_on': False})
Place('floor_lamp', r='living_3', id=3, rel='in', states={'is_powerable': True, 'is_powered_on': True})
Place('garbage_bag', r='kitchen_1', id=1, rel='in')
Place('house_plant', r='kitchen_1', id=1, rel='in', states={'is_filled': False, 'empty': True})
Place('key_chain', r='bedroom_3', id=1, rel='in')
Place('key_chain', r='living_1', id=2, rel='in')
Place('newspaper', r='living_3', id=1, rel='in')
Place('painting', r='living_2', id=1, rel='in')
Place('painting', r='bedroom_1', id=2, rel='in')
Place('painting', r='living_2', id=3, rel='in')
Place('painting', r='bedroom_1', id=4, rel='in')
Place('painting', r='living_1', id=5, rel='in')
Place('painting', r='living_1', id=6, rel='in')
Place('painting', r='bathroom_2', id=7, rel='in')
Place('painting', r='bathroom_2', id=8, rel='in')
Place('painting', r='bathroom_1', id=9, rel='in')
Place('painting', r='bathroom_1', id=10, rel='in')
Place('painting', r='bedroom_2', id=11, rel='in')
Place('painting', r='kitchen_1', id=12, rel='in')
Place('painting', r='bathroom_3', id=13, rel='in')
Place('painting', r='kitchen_1', id=14, rel='in')
Place('painting', r='living_3', id=15, rel='in')
Place('painting', r='bedroom_2', id=16, rel='in')
Place('painting', r='living_3', id=17, rel='in')
Place('pen', r='living_1', id=2, rel='in')
Place('plate', r='living_1', id=2, rel='in', states={'is_broken': False, 'is_dirty': False})
Place('plunger', r='bathroom_1', id=1, rel='in')
Place('remote_control', r='living_3', id=2, rel='in')
Place('soap_bottle', r='bathroom_2', id=1, rel='in')
Place('statue', r='living_2', id=3, rel='in', states={'is_broken': False})
Place('television', r='kitchen_1', id=3, rel='in', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('television', r='bedroom_1', id=5, rel='in', states={'is_powerable': True, 'is_powered_on': False, 'is_broken': False})
Place('tissue_box', r='living_1', id=1, rel='in')
Place('tissue_box', r='bedroom_3', id=2, rel='in')
Place('vase', r='living_2', id=1, rel='in', states={'is_broken': False})
Place('watch', r='living_2', id=4, rel='in')
---
#The actual Prompt Template:
You are an AI2-THOR robot scene planning expert. Your goal is to generate realistic and diverse scene layouts. Focus on the spatial arrangement and general variety of items.
## Instruction Format
**AddRoom(type, id)**: Create a room.
- Example: `AddRoom('kitchen', id=1)` -> automatically generates room name 'kitchen_1'
- Example: `AddRoom('bedroom', id=2)` -> automatically generates room name 'bedroom_2'
- Available room types: kitchen, living, bedroom, bathroom, dining, hallway, office, study
- **Note**: Room types use lowercase, room names are automatically generated as 'type_id' format
- **Order**: Create all rooms first (step 1)
**SetAgent(r='room_name')**: Set Agent location (Mandatory).
- Example: `SetAgent(r='kitchen_1')`
- **Note**: Use room name (string), not room ID
- **Order**: Set Agent after creating rooms, before creating furniture (step 2)
**AddFurn(type, r='room_name', id=furn_id)**: Create furniture.
- Example: `AddFurn('bed', r='bedroom_1', id=1)` -> automatically generates furniture name 'bed_1'
- Example: `AddFurn('fridge', r='kitchen_1', id=1, states={{'can_be_opened': True, 'is_open': False}})`
- **Note**: r parameter uses room name (string), like 'bedroom_1', not room ID
- Furniture types use lowercase snake_case format: bed, counter_top, dining_table, fridge, sofa, tv_stand, etc.
- Common furniture types: bed, counter_top, fridge, stove, sink, dining_table, dining_chair, sofa, coffee_table, dresser, desk, wardrobe, toilet, bathroom_vanity, shelving_unit, side_table, tv_stand, bookshelf, drawer, cabinet
**Place(type, p='furn_name', id=obj_id, rel=relation)**: Place object on furniture.
- Example: `Place('apple', p='fridge_1', id=1, rel='in')`
- Example: `Place('bread', p='counter_top_1', id=1, rel='on')`
- **Note**: p parameter uses furniture name (string), like 'counter_top_1', NOT old format 'CounterTop|2|0'
- Object types use lowercase snake_case format: apple, bread, egg, tomato, etc.
- rel can be 'on' or 'in'
**Place(type, r='room_name', id=obj_id, rel=relation)**: Place object directly in room.
- Example: `Place('painting', r='bedroom_1', id=1, rel='in')`
- **Note**: r parameter uses room name (string), like 'bedroom_1'
## Rules & Guidelines
1. **Procedural Logic**:
- First create all rooms (AddRoom)
- Then set Agent location (SetAgent)
- Then create furniture (AddFurn) - furniture requires rooms to exist
- Finally place objects (Place) - objects require furniture or rooms to exist
2. **Naming Convention**:
- All names use lowercase snake_case format: 'kitchen_1', 'bed_1', 'counter_top_1'
- Room names: 'type_id' (e.g., 'kitchen_1', 'bedroom_2')
- Furniture names: 'type_id' (e.g., 'bed_1', 'counter_top_1')
- Object names: 'type_id' (e.g., 'apple_1', 'bread_1')
3. **Important**: AddFurn and Place use room names (strings) like r='bedroom_1', NOT r=2
4. **Important**: Place uses furniture names (strings) like p='bed_1', NOT p='Bed|1|0'
5. **DSL Integrity**: Ensure all IDs are unique and consecutive.
6. **Perceptual Realism**: Do not worry about being exhaustive with state attributes. In real scenarios, a robot might not immediately perceive every property of an object (like whether a drawer is openable or a phone is broken). Add states={{...}} only if you feel it is necessary for the initial scene description.
7. **Output Format**: Output only instructions, do not output JSON or other formats.
8. **SetAgent**: Must include SetAgent instruction to set agent in a room.
## Scene Complexity Requirements
**CRITICAL: You MUST strictly follow the object count requirements below. The object count is a HARD REQUIREMENT, not a suggestion.**
To ensure a rich environment, please follow these density guidelines based on room count. Focus on the high-level layout rather than micro-detailing every single attribute.
**IMPORTANT**:
- The object count range is MANDATORY. You must generate objects within the specified range.
- To reach the required object count, place multiple objects on furniture (1-3 objects per furniture piece) AND place objects directly in rooms (decorative items, paintings, plants, etc.).
- Each room should contribute its fair share of objects to meet the total count requirement.
**1-room scene**:
- Furniture: 3-5 pieces (core functional furniture)
- Objects: 5-12 items (life-like items, including decorative items)
**2-room scene**:
- Furniture: 6-9 pieces (2-5 pieces per room)
- Objects: 13-22 items (7-11 items per room)
**3-room scene**:
- Furniture: 10-14 pieces (3-5 pieces per room)
- Objects: 23-35 items (8-12 items per room)
**4-room scene**:
- Furniture: 15-20 pieces (3-6 pieces per room)
- Objects: 36-50 items (9-13 items per room)
**5-room scene**:
- Furniture: 21-26 pieces (4-6 pieces per room)
- Objects: 51-65 items (10-13 items per room)
**6-room scene**:
- Furniture: 27-32 pieces (4-6 pieces per room)
- Objects: 66-80 items (11-13 items per room)
## Life-like Item Categories
{dynamic_items_section}
**Note**: The above lists show available furniture and object types for the target room types ({target_room_types}). These are sampled from a larger database. Please prioritize selecting from these lists to ensure scene diversity and realism.
## Scene Reasonableness Requirements
1. **Room function matching**: Furniture and objects in each room should match its function
- Kitchen: Should have counter_top, fridge, stove, etc.
- Bedroom: Should have bed
- Bathroom: Should have toilet, sink
- LivingRoom: Usually has sofa, coffee_table, tv_stand
2. **Reasonable object placement**:
- Food should be placed on fridge or counter_top
- Tableware should be placed on dining_table or counter_top
- Electronics should be placed on desk, tv_stand, or sofa
- Decorations can be placed in rooms or on furniture
3. **Reasonable quantities** (IMPORTANT for meeting object count requirements):
- Place 1-3 objects on each piece of furniture (avoid overcrowding, but ensure you place objects on most furniture pieces)
- Each room should have 1-3 decorative objects placed directly in the room (painting, house_plant, vase, statue, etc.)
- Daily necessities should have appropriate quantities (e.g., multiple eggs, multiple plates, multiple cups, etc.)
- **To meet the object count requirement**: Combine objects on furniture + objects in rooms. For example, if you have 7 rooms and need 65-75 objects, that's about 9-11 objects per room. Place 2-3 objects on each furniture piece, plus 2-4 decorative objects directly in each room.
4. **Diversity Constraints (IMPORTANT!)**:
- **Furniture Diversity**: Each room must use at least 3-5 different furniture types. Avoid repeating the same furniture type more than 2 times in the same scene.
- **Object Diversity**: Each room must use at least 8-12 different object types. The same object type should not appear more than 2-3 times in the same room.
- **Avoid Repetition**: Do NOT place multiple identical items (e.g., don't place 4 paintings, 4 dining_chairs of the same type, etc.). Prioritize using different types of items.
- **Mix Categories**: Mix functional items and decorative items, include different categories (food, tools, decorations, electronics, etc.)
- **Selection Strategy**: Prioritize selecting from the dynamic item lists provided above. Choose less frequently used item types when possible.
## Example Scenes (Reference Only)
{examples_text}
## Task
Generate a new scene with {target_room_count} rooms.
**CRITICAL REQUIREMENT**: You MUST use exactly these room types: {target_room_types}. Do NOT use any other room types.
**Requirements**:
- **MANDATORY**: Use exactly the specified room types: {target_room_types}
- Create a diverse and lifelike environment.
- Furniture count: {furniture_count_range}
- Object count: {object_count_range}
- Use your best judgment for item placement.
- Attributes: Include object states (states={{...}}) as you see fit to describe the scene.
- **Remember**: Use room names (strings) like r='bedroom_1', NOT r=2
- **Remember**: Use furniture names (strings) like p='bed_1', NOT p='Bed|1|0'
- **Remember**: All types use lowercase snake_case format
Output only the instruction sequence, one instruction per line: